<template>
  <div>
    <div v-for="menu in menus" :key="menu.path">
      <el-submenu
        v-if="menu.children && menu.children.length > 0"
        :index="menu.path"
      >
        <template slot="title">
          <i class="iconfont" :class="menu.meta.icon"></i>
          <!-- <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-mianxingdingdan"></use>
          </svg> -->
          <span>{{ menu.meta.title }}</span>
        </template>
        <navbar-item :menus="menu.children"></navbar-item>
      </el-submenu>
      <el-menu-item v-else :index="menu.path">
        <!-- <i class="el-icon-menu"></i> -->
        <!-- <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-xianxingdiannao"></use>
        </svg> -->
        <i class="iconfont" :class="menu.meta.icon"></i>
        <span slot="title">{{ menu.meta.title }}</span>
      </el-menu-item>
    </div>
  </div>
</template>

<script>
export default {
  name: "NavbarItem",
  props: {
    menus: {
      type: Array,
      require: true,
    },
  },
};
</script>

<style>
.el-menu--collapse .el-submenu__title span {
  display: none;
    max-height: 660px;
}
.el-menu[data-v-c735de7a]{
  max-height: 100%;
}
</style>